package linked;

/**
 * @author
 * @date 2025/4/15 19:51
 */
public class LinkedList{
    public LinkedNode header;
    public LinkedList(LinkedNode header){
        this.header = header;
    }
    public void add(LinkedNode node){
        LinkedNode temp = header;
        while (temp.next!=null){
            temp = temp.next;
        }
        temp.next = node;
    }

    public void print(){
        LinkedNode temp = header;
        while (temp.next!=null){
            System.out.print(temp.value+"==>");
            temp = temp.next;
        }
        System.out.print(temp.value);
    }

}
class LinkedNode {
    public String value;
    LinkedNode next;

    public LinkedNode(String value) {
        this.value = value;
    }
}




